package com.huang.weic.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.huang.weic.bean.User;
import com.huang.weic.mapper.UserMapper;
import com.huang.weic.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Wrapper;

@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements  UserService {
    @Autowired
    private UserMapper userDao;
    @Override
    public void addUser(User user) {
        QueryWrapper<User> wrapper = new QueryWrapper<>();
        wrapper.eq("openid",user.getOpenid());
        User user1 = userDao.selectOne(wrapper);
    if(user1==null){
        userDao.insert(user);
    }
        return;

    }
}
